/**
 * created by dqn 2018/3/7 19:25
 */

package main.service;

import main.entity.Song;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

public interface SongService {
    public Song getSongById(int pk);


    public Map<String,List<Song>> getSongsByContains(String key);

    public Map<String, List<String>> getSongCategories();

    public List<Song> getAllSongs();

    public Song uploadSong(HttpSession httpSession, Song data, MultipartFile song, MultipartFile image);

    /**
     * 用歌名的精确搜索
     *
     * @param name
     * @return
     */
    public Song getSongByName(String name);

    /**
     * 风格分类查询
     *
     * @param style    风格名称
     * @param pageable 分页
     * @return
     */
    public Page<Song> getSongsInPageByStyle(String style, Pageable pageable);

    public Page<Song> getSongsInPageByLanguage(String language, Pageable pageable);

    public Page<Song> getAll(Pageable pageable);

    public List<Song> getAllByClickLimitedTo(int size);

    public Song updateSong(Song song);

    public boolean deleteById(int id);

    public List<Song> getNewSongsLimit(int limit);
}
